package com.Service.Impl;

import com.Mapper.UserMapper;
import com.Service.UserService;
import com.entity.User;
import com.utils.SqlSessionUtils;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * @Author: 冷俊杰
 * @Description: 用户Service实现类
 * @DateTime: 2022/6/2 10:25
 **/
public class UserServiceImpl implements UserService {
    SqlSession sqlSession = SqlSessionUtils.getSqlSession();
    UserMapper userMapper = sqlSession.getMapper(UserMapper.class);

    @Override
    public User UserByNP(String phone, String password) {
        return userMapper.UserByNP(phone, password);
    }

    public int insertUser(User user) {
        return userMapper.insertUser(user);
    }

    public List<User> SelectUser(Integer state) {
        return userMapper.SelectUser(state);
    }

    public int deleteUser(Integer id) {
        return userMapper.deleteUser(id);
    }

    public User SelectUserById(Integer id) {
        return userMapper.SelectUserById(id);
    }

    public int UpdateUserById(User user) {
        return userMapper.UpdateUserById(user);
    }

    public int SelectUserByHs() {
        return userMapper.SelectUserByHs();
    }

    public int UpdateUserByState(User user) {
        return userMapper.UpdateUserByState(user);
    }

    public List<User> LISTUer(String phone) {
        return userMapper.LISTUer(phone);
    }

}
